﻿package com.sgcc.nfc.lock.core.util

import com.sgcc.nfc.lock.core.network.NetworkResult

fun <T> NetworkResult<T>.toUiState(): UiState<T> = when (this) {
    is NetworkResult.Success -> UiState.Success(data)
    is NetworkResult.Error -> UiState.Error(message)
    NetworkResult.Loading -> UiState.Loading
}
